<div class="row"">
<div class="col-md-2">
    <?php include(dirname(dirname(__FILE__)).'/sidebar.phtml');?>
</div>
<div class="col-md-10">
  <form class="form-inline task" action="/manage/stat/linkstat/" method = "GET">
    <div class="form-group">
      <label class="control-label">链接ID</label>
      <input class="form-control" name="stid" type="text" placeholder="链接ID" value="<?php if(!empty($params['stid'])): echo $params['stid']; endif;?>">
    </div>
    <div class="form-group">
      <label class="control-label">标题</label>
      <input class="form-control" name="title" type="text" placeholder="标题" value="<?php if(!empty($params['title'])): echo $params['title']; endif;?>">
    </div>
    <div class="form-group">
      <label class="control-label">开始日期</label>
      <input class="form-control" name="start_date" type="text" autocomplete="off" id="startTime" value="<?php if (!empty($params['start_time'])): ?><?php echo date('Y-m-d', $params['start_time']); ?> <?php endif; ?>">
      至
      <input class="form-control" name="end_date" type="text" autocomplete="off" id="endTime" value="<?php if (!empty($params['end_time'])): ?><?php echo date('Y-m-d', $params['end_time']); ?> <?php endif; ?>">
    </div>
    <button type="submit" class="btn btn-default">搜索</button>
  </form>
  <div class="panel panel-default">
    <div class="panel-heading clearfix">
      链接每日点击统计
    </div>
    <div class="panel-body">
      <table class="table table-bordered table-striped">
        <thead>
        <tr><th>日期</th><th>统计ID</th><th>标题</th><th>点击</th></tr>
        </thead>
        <tbody>
          <?php foreach ($list as $id => $row):?>
            <tr>
              <td><?php echo $row['date']?></td>
              <td><?php echo $row['stid']?></td>
              <td><?php echo $row['title']?></td>
              <td><?php echo $row['click_nums'] ?></td>
            </tr>
          <?php endforeach;?>
        </tbody>
      </table>
      <?php $pager->render();?>
    </div>
  </div>
</div>
<script type="text/javascript">
  $(function () {
    $("#startTime").datetimepicker({format:"Y-m-d H:i:00"});
    $("#endTime").datetimepicker({format:"Y-m-d H:59:59"});
  })
</script>